package com.chiao.dao.admin;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.chiao.core.BaseDao;
import com.chiao.entity.admin.Action;
import com.chiao.entity.admin.DDNS;

@Repository
public class LoginDao extends BaseDao{

	private static final String INSERT_SQL = "select USERNAME,PASSWORD  from ddns";  
	private static final String INSERT_SQL2 = "insert into ddns values('1','2','3')";  
	private static final String ACTION_SQL = "SELECT key FROM config";  
	
	public void login(){
		List list=queryForList(INSERT_SQL);
		System.out.println(list==null);
	}
	
	public void login2(){
		this.update(INSERT_SQL2);
	}
	
	public DDNS getDDNS(){
		return this.queryForBean(DDNS.class, INSERT_SQL);
	}
	
	public String getActions(){
		return this.queryForString( ACTION_SQL);
	}
	
	public long addDDNS(){
		return this.saveForGeneratedKey("insert into floor(ord) values(?)", "id", 888);
	}
}
